﻿
Partial Class Paginas_VerImagen
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Dim ImgID As String = Request.QueryString("imgID")
            Dim miCollect As New Collection
            Dim miNegTAdm As New dllNegocio.NegImagenes(System.Configuration.ConfigurationManager.AppSettings.Get("SPECBDD"))
            Dim objImg As New dllEntidades.clsImagenes
            Dim imgEncontrada As Boolean = False
            Try
                miCollect = miNegTAdm.ListaImagenesDeMapas()
                For x As Integer = 1 To miCollect.Count
                    objImg = CType(miCollect(x), dllEntidades.clsImagenes)
                    If objImg.Codigo = ImgID Then
                        Me.litImg.Text = "<img src='img/ImgLoad/Imagenes/" & objImg.NombreImagen.ToString.Trim & "' alt='' height='380' width='380' />"
                        imgEncontrada = True
                    End If
                Next
            Catch ex As Exception
            Finally
                miCollect = Nothing
                miNegTAdm.Dispose()
                miNegTAdm = Nothing
                objImg.Dispose()
                objImg = Nothing
            End Try
            If imgEncontrada = False Then
                UtilidadesPagina.EjecutaScript("alert('Mapa no encontrado');window.close();", Me.Page)
            End If
        End If
    End Sub
End Class